Imports Clo = Enhancements.Core.Logging
Imports Ref = System.Reflection
Imports Sys = System

Namespace Enhancements.Basic
    ''' <summary>The exception that is thrown when a XML is not valid.</summary>
    <Serializable(), DebuggerStepThrough()> _
    Public NotInheritable Class IsXmlValidNotException
        Inherits AssertException

        Private Sub New(ByVal _objectName As System.String, ByVal _objectXml() As System.Byte, ByVal _objectXmlSchema() As System.Byte)
            MyBase.New(_objectName)
            ObjectXml = _objectXml
            ObjectXmlSchema = _objectXmlSchema
        End Sub

        Private __ObjectXml() As System.Byte = CType(Sys.Array.CreateInstance(GetType(Byte), 0), Byte())
        ''' <summary>Gets the XML used as data.</summary>
        Public Property ObjectXml() As System.Byte()
            Get
                Return __ObjectXml
            End Get
            Private Set(ByVal _value() As System.Byte)
                __ObjectXml = _value
            End Set
        End Property

        Private __ObjectXmlSchema() As System.Byte = CType(Sys.Array.CreateInstance(GetType(Byte), 0), Byte())
        ''' <summary>Gets the XML Schema used as validation.</summary>
        Public Property ObjectXmlSchema() As System.Byte()
            Get
                Return __ObjectXmlSchema
            End Get
            Private Set(ByVal _value() As System.Byte)
                __ObjectXmlSchema = _value
            End Set
        End Property

        ''' <summary>Throws an exception.</summary>
        ''' <param name="_objectName">Name of the object that is causing the exception.</param>
        ''' <param name="_objectXml">XML that is causing the exception.</param>
        ''' <param name="_objectXmlSchema">XML Schema that is causing the exception.</param>
        ''' <exception cref="IsXmlValidNotException"> </exception>
        Friend Shared Sub ___Throw(ByVal _objectName As System.String, ByVal _objectXml() As System.Byte, ByVal _objectXmlSchema() As System.Byte)
            Dim _exception As IsXmlValidNotException = New IsXmlValidNotException(_objectName, _objectXml, _objectXmlSchema)

            Throw _exception
        End Sub

    End Class
End Namespace
